home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cat2 / standard / statfs.z / statfs
Encoding:
Text File  |  2002-10-03  |  6.5 KB  |  133 lines

  1.  
  2.  
  3.  
  4. SSSSTTTTAAAATTTTFFFFSSSS((((2222))))                                                            SSSSTTTTAAAATTTTFFFFSSSS((((2222))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      statfs, fstatfs - get file system information
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      ####iiiinnnncccclllluuuuddddeeee <<<<ssssyyyyssss////ttttyyyyppppeeeessss....hhhh>>>>
  13.      ####iiiinnnncccclllluuuuddddeeee <<<<ssssyyyyssss////ssssttttaaaattttffffssss....hhhh>>>>
  14.  
  15.      iiiinnnntttt ssssttttaaaattttffffssss ((((ccccoooonnnnsssstttt cccchhhhaaaarrrr ****ppppaaaatttthhhh,,,, ssssttttrrrruuuucccctttt ssssttttaaaattttffffssss ****bbbbuuuuffff,,,, iiiinnnntttt lllleeeennnn,,,, iiiinnnntttt ffffssssttttyyyypppp))));;;;
  16.  
  17.      iiiinnnntttt ffffssssttttaaaattttffffssss ((((iiiinnnntttt ffffiiiillllddddeeeessss,,,, ssssttttrrrruuuucccctttt ssssttttaaaattttffffssss ****bbbbuuuuffff,,,, iiiinnnntttt lllleeeennnn,,,, iiiinnnntttt ffffssssttttyyyypppp))));;;;
  18.  
  19. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  20.      _s_t_a_t_f_s returns a ``generic superblock'' describing a file system.  It can
  21.      be used to acquire information about mounted as well as unmounted file
  22.      systems, and usage is slightly different in the two cases.  In all cases,
  23.      _b_u_f is a pointer to a structure (described below) which will be filled by
  24.      the system call, and _l_e_n is the number of bytes of information which the
  25.      system should return in the structure.  _L_e_n must be no greater than
  26.      ssssiiiizzzzeeeeooooffff ((((ssssttttrrrruuuucccctttt ssssttttaaaattttffffssss)))) and ordinarily it will contain exactly that value;
  27.      if it holds a smaller value the system will fill the structure with that
  28.      number of bytes.  (This allows future versions of the system to grow the
  29.      structure without invalidating older binary programs.)
  30.  
  31.      If the file system of interest is currently mounted, _p_a_t_h should name a
  32.      file which resides on that file system.  In this case the file system
  33.      type is known to the operating system and the _f_s_t_y_p argument must be
  34.      zero.  For an unmounted file system _p_a_t_h must name the block special file
  35.      containing it and _f_s_t_y_p must contain the (non-zero) file system type.  In
  36.      both cases read, write, or execute permission of the named file is not
  37.      required, but all directories listed in the path name leading to the file
  38.      must be searchable.
  39.  
  40.      The _s_t_a_t_f_s structure pointed to by _b_u_f includes the following members:
  41.           short   f_fstyp;    /* File system type */
  42.           long    f_bsize;    /* Block size */
  43.           long    f_frsize;   /* Fragment size */
  44.           long    f_blocks;   /* Total number of blocks */
  45.           long    f_bfree;    /* Count of free blocks */
  46.           long    f_files;    /* Total number of file nodes */
  47.           long    f_ffree;    /* Count of free file nodes */
  48.           char    f_fname[6]; /* Volume name */
  49.           char    f_fpack[6]; /* Pack name */
  50.  
  51.      In ABI N32 applications, the fields ffff____bbbblllloooocccckkkkssss, ffff____bbbbffffrrrreeeeeeee, ffff____ffffiiiilllleeeessss, and
  52.      ffff____ffffffffrrrreeeeeeee are of type ________iiiinnnntttt66664444____tttt (lllloooonnnngggg lllloooonnnngggg) instead of lllloooonnnngggg.
  53.  
  54.      _f_s_t_a_t_f_s is similar, except that the file named by _p_a_t_h in _s_t_a_t_f_s is
  55.      instead identified by an open file descriptor _f_i_l_e_d_e_s obtained from a
  56.      successful _o_p_e_n(2), _c_r_e_a_t(2), _d_u_p(2), _f_c_n_t_l(2), or _p_i_p_e(2) system call.
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. SSSSTTTTAAAATTTTFFFFSSSS((((2222))))                                                            SSSSTTTTAAAATTTTFFFFSSSS((((2222))))
  71.  
  72.  
  73.  
  74.      _s_t_a_t_f_s obsoletes _u_s_t_a_t(2) and should be used in preference to it in new
  75.      programs.
  76.  
  77.      For XFS filesystems with real-time subvolumes (see xfs(4)), the _s_t_a_t_f_s(2)
  78.      system call returns information concerning the data portion of the
  79.      filesystem only.  The _s_y_s_s_g_i(2) system call with the SGI_XFS_OPERATIONS
  80.      request argument can be used to acquire information concerning the size
  81.      and usage of space within the real-time portion of the filesystem.
  82.  
  83.      _s_t_a_t_f_s and _f_s_t_a_t_f_s will fail if one or more of the following are true:
  84.  
  85.      [ENOTDIR]      A component of the path prefix is not a directory.
  86.  
  87.      [ENOENT]       The named file does not exist.
  88.  
  89.      [EACCES]       Search permission is denied for a component of the path
  90.                     prefix.
  91.  
  92.      [EFAULT]       _B_u_f or _p_a_t_h points to an invalid address.
  93.  
  94.      [EBADF]        _F_i_l_d_e_s is not a valid open file descriptor.
  95.  
  96.      [EINVAL]       _F_s_t_y_p is an invalid file system type; _p_a_t_h is not a block
  97.                     special file and _f_s_t_y_p is nonzero; _l_e_n is negative or is
  98.                     greater than ssssiiiizzzzeeeeooooffff ((((ssssttttrrrruuuucccctttt ssssttttaaaattttffffssss)))).
  99.  
  100. DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
  101.      Upon successful completion a value of 0 is returned.  Otherwise, a value
  102.      of -1 is returned and _e_r_r_n_o is set to indicate the error.
  103.  
  104. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  105.      chmod(2), chown(2), creat(2), link(2), mknod(2), pipe(2), read(2),
  106.      statvfs(2), time(2), unlink(2), utime(2), write(2), fs(4).
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.